package com.mobile.framework.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class ChsDate {
	
	final static String dayNames[] = {"星期天","星期一", "星期二", "星期三", "星期四", "星期五","星期六" };

	public static String getChsXQ(Date date) throws ParseException {
	
		Calendar calendar = Calendar.getInstance();
	    calendar.setTime(date);
	    int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
	    return dayNames[dayOfWeek - 1];
	}
	
    public static String getChsXQ(String datestr) throws ParseException {
        SimpleDateFormat sdfInput = new SimpleDateFormat("yyyy-MM-dd");
        return ChsDate.getChsXQ(sdfInput.parse(datestr));
    }

  

}
